package com.megan.design.pattern.creational.simplefactory;

import lombok.extern.slf4j.Slf4j;

/**
 * @Author: megan
 * @Data: 2018/8/24 上午8:05
 * @Description:
 */
@Slf4j
public class Test {
//    public static void main(String[] args) {
//        Video java = new JavaVideo();
//        java.produce();
//        log.info("=====================");
//        Video python = new PythonVideo();
//        python.produce();
//        log.info("=====================");
//        VideoFactory factory = new VideoFactory();
//        Video javaVideo = factory.getVideo(VideoFactory.JAVA);
//        if (javaVideo == null) {
//            return;
//        }
//        javaVideo.produce();
//        log.info("=====================");
//        Video pythonVideo = factory.getVideo(VideoFactory.PYTHON);
//        if (pythonVideo == null) {
//            return;
//        }
//        pythonVideo.produce();
//
//    }

    public static void main(String[] args) {
        VideoFactory videoFactory = new VideoFactory();
        Video video = videoFactory.getVideo(JavaVideo.class);
        video.produce();
    }
}
